<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body, html {
            padding: 0px;
            margin: 0px;
            width: 100%;
            height: 100%;
        }
        table {
            border-spacing: 0;
        }
        tr {
            height: 35px;
        }

        th {
            text-align: center;
        }
        .top_tag {
            border-bottom: #01AAED solid 2px;
            color: #01AAED;
        }
        .a_tag_cla{
            display: block;
            /*超出隐藏*/
            overflow: hidden;
            /*禁止换行*/
            white-space: nowrap;
            /*超出用省略号代替*/
            text-overflow: ellipsis;height: 30px;line-height: 30px;padding-left: 1%;
        }
        .tab_top {
            width: 100px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            display: inline-block;
            cursor: pointer;
        }

        .file {
            position: relative;
            display: inline-block;
            background: #D0EEFF;
            border: 1px solid #99D3F5;
            border-radius: 4px;
            padding: 4px 12px;
            overflow: hidden;
            color: #1E88C7;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
        }

        .file input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }

        .file:hover {
            background: #AADFFD;
            border-color: #78C3F3;
            color: #004974;
            text-decoration: none;
        }
        #loading { background: #fff url(../../static/public_file/images/jiazai.gif) no-repeat scroll center center; height: 100%; width: 100%; background-size: 10%; position: fixed; margin-top: 0px; top: 0px; left: 0px; bottom: 0px; overflow: hidden !important; right: 0px; z-index: 999999;background-color: rgba(255, 255, 255, 0.08);}

    </style>
</head>
<body>
    <div id="loading">
        <div id="loading-center">
        </div>
    </div>

    <div style="width: 100%;height: 40px;background: white;border-bottom: #cfcfcf solid 0.5px;line-height: 40px;color: black;">
        <div id="DW_tag" class="tab_top top_tag" onclick="change_mind('DW')">
            申请详情
        </div>
        <div id="LH_tag" class="tab_top" onclick="change_mind('LH')">
            附件
        </div>
        <div id="lct_tag" class="tab_top" onclick="change_mind('lct')">
            流程图
        </div>
        <button onclick="ExportCar()" style="float: right;width: 100px;height: 30px;line-height: 30px;margin-top: 5px;border-radius: 3px;border: #1E90FF solid 0.5px;background-color: #1E90FF;color: white;cursor: pointer;margin-right: 15px;">提交</button>

        <div style="width: 110px;float: right;text-align: center;height: 40px;">
            <button style="line-height: 27px;border-radius: 3px;border: #1E90FF solid 0.5px;width: 100px;height: 30px;margin-top: 5px;background: #1E90FF;color: white;"><a href="javascript:history.go(-1)" style="color: white;">返回</a></button>
        </div>
    </div>

    <div id="DW" style="width: 100%;height: 94.5%;background: white;overflow: auto;">
        <div id="menu_from" style="width: 100%;height: 100%;">
            <div style="width: 90%;margin-left: 5%;padding-top: 2%;">
                <table style="width: 100%;">
                    <tr style="width: 100%;">
                        <td colspan="4" style="width: 100%;border: #cfcfcf solid 0.5px;text-align: center;height: 35px;line-height: 35px;">
                            <h3 id="form_name" style="text-align: center;">印章/重要证件使用(借用)审批单</h3>
                        </td>
                    </tr>
                    <tr style="width: 100%;">
                        <td colspan="4" style="width: 100%;margin-left: 2.5%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5;border: #cccccc solid 0.5px;color: #1E90FF;">
                            申请详情
                        </td>
                    </tr>
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            申&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;人
                        </td>
                        <td id="ngr" style="width: 35%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 0.5%;border-top: none;">{{ obj.apply_user.real_name }}</td>
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            申请日期
                        </td>
                        <td id="gwwh" style="width: 35%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;outline: none;border-top: none;">{{ obj.create_time | date:'Y-m-d H:i' }}</td>
                    </tr>
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            用&nbsp;&nbsp;印&nbsp;&nbsp;&nbsp;事&nbsp;&nbsp;&nbsp;由
                        </td>
                        <td id="" style="width: 35%;border-right: #cfcfcf solid 0.5px;border-left: #cfcfcf solid 0.5px;border-bottom: #cfcfcf solid 0.5px;height: 40px;line-height: 35px;padding-left: 0.5%;" title="{{ obj.matter_type_text }}">
                            {% if is_edit == 'true' %}
                                {% if Quick == 'true' %}
                                    <select name="" id="yysy" style="width: 100%;height: 100%;border: none;outline: none;" onchange="OrNotFill()">
                                        {% for str in str_list %}
                                            <option value="{{ str }}" {% if obj.matter_type_text == str %} selected {% endif %}>{{ str }}</option>
                                        {% endfor %}
                                        <option value="其他">其他</option>
                                    </select>
                                {% else %}
                                    <div id="yysy" style="width: 100%;height: 100%;border: none;outline: none;" contenteditable="{{ is_edit }}">{{ obj.matter_type_text }}</div>
                                {% endif %}
                            {% else %}
                                <div id="yysy" style="width: 100%;height: 100%;border: none;outline: none;" contenteditable="{{ is_edit }}">{{ obj.matter_type_text }}</div>
                            {% endif %}
                        </td>
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            用印次数
                        </td>
                        <td id="" style="width: 35%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;">
                            <input type="number" value="{{ obj.servings }}" readonly id="fenshu" style="width: 100%;height: 100%; border: none; outline: none"></td>
                    </tr>
                    {% if is_edit == 'true' %}
                        <tr style="width: 100%;">
                            <td style="height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;">
                                分&nbsp;&nbsp;&nbsp;管&nbsp;&nbsp;&nbsp;领&nbsp;&nbsp;导
                            </td>
                            <td style="height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 0.5%;{% if is_edit == 'true' %} width: 35%; {% else %} width: 85%; {% endif %}" {% if is_edit == 'false' %} colspan="3" {% endif %} id="leader_charge">
                                <select name="" id="leader_select" style="width: 100%;height: 100%;border: none;outline: none;">
                                    <option value="">请选择分管领导</option>
                                    {% for foo in leaders_obj %}
                                        <option value="{{ foo.id }}" {% if Bstep == foo.real_name %} selected {% endif %}>{{ foo.real_name }}</option>
                                    {% endfor %}
                                </select>
                            </td>
                            <td style="width: 15%;height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;">
                                文件类型
                            </td>
                            <td style="height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 1%;width: 35%;" id="leader_charge">
                                <select name="" id="FileType" style="width: 100%;height: 100%;border: none;outline: none;">
                                    <option value="0">请选择文件类型</option>
                                    <option value="1" {% if obj.FileType == "1" %} selected {% endif %}>协议类</option>
                                    <option value="2" {% if obj.FileType == "2" %} selected {% endif %}>非协议类</option>
                                </select>
                            </td>
                        </tr>
                    {% endif %}
                    {% if obj.state == 'five' %}
                        <td style="height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;">
                            用&nbsp;&nbsp;&nbsp;印&nbsp;&nbsp;&nbsp;编&nbsp;&nbsp;号
                        </td>
                        <td style="height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 0.5%;" colspan="3" id="">
                            {{ obj.number }}
                        </td>
                    {% endif %}
                    <tr id="yy_detail" style="display: none;">
                        <td style="height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;">
                            用&nbsp;&nbsp;&nbsp;印&nbsp;&nbsp;&nbsp;详&nbsp;&nbsp;情
                        </td>
                        <td style="height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 1%;" colspan="3" id="leader_charge">
                            <div id="YDetail" style="width: 100%;height: 100%;border: none;outline: none;" contenteditable="true"></div>
                        </td>
                    </tr>
                    <tr style="width: 100%;position: relative;">
                        {% if obj.credentials %}
                            <td id="NameOfSeal" style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                印章/证件名称
                            </td>
                            <td id="NameOfSealInput" title="{{ obj.seal_name }}" style="width: 35%;height: 40px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;position: relative;font-size: 0;">
                                <div onclick="myclick1()" id="selectButton_1" style="width:100%;height:100%;font-size:14px;border: none;padding-left: 0.5%;">{{ obj.seal_name }}</div>
                                <div id="selectdiv_1" style="display:none;width:100%;font-size:14px;position: absolute;background: white;z-index: 3000;border: #cfcfcf solid 0.5px;" onMouseOver="mousein1()" onMouseOut="mouseout1()">
                                    {% for seal in seal_obj %}
                                        <input class="check_anniu" style="margin-left: 0.5%;" type="checkbox" value="{{ seal.seal_name }}" onclick="mycheck1(this)"> {{ seal.seal_name }}<br>
                                    {% endfor %}
                                </div>
                            </td>
                            <td id="CertificateName" style="width: 15%;border: #cfcfcf solid 0.5px;height: 40px;line-height: 35px;text-align: right;border-top: none;padding-right: 1%;">
                                证件名称
                            </td>
                            <td id="CertificateNameInput" style="width: 35%;height: 40px;border: #cfcfcf solid 0.5px;line-height: 35px;text-align: right;border-top: none;padding-left: 1%">
                                <input id="zjmc" type="text" style="width: 100%; height: 100%;border: none;" value="{{ obj.credentials }}" {% if is_edit == 'false' %} readonly {% endif %} >
                            </td>
                        {% else %}
                            <td id="NameOfSeal" style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                印章/证件名称
                            </td>
                            <td id="NameOfSealInput" colspan="3" title="{{ obj.seal_name }}" style="width: 85%;height: 40px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;position: relative;font-size: 0;">
                                <div onclick="myclick1()" id="selectButton_1" style="width:100%;height:100%;font-size:14px;border: none;padding-left: 0.5%;">{{ obj.seal_name }}</div>
                                <div id="selectdiv_1" style="display:none;width:100%;font-size:14px;position: absolute;background: white;z-index: 3000;border: #cfcfcf solid 0.5px;" onMouseOver="mousein1()" onMouseOut="mouseout1()">
                                    {% for seal in seal_obj %}
                                        <input class="check_anniu" style="margin-left: 0.5%;" type="checkbox" value="{{ seal.seal_name }}" onclick="mycheck1(this)"> {{ seal.seal_name }}<br>
                                    {% endfor %}
                                </div>
                            </td>
                        {% endif %}
                    </tr>

                    {% if obj.transfer == "1" %}
                        <tr style="width: 100%;">
                            {% if obj.types == 'a' %}
                                <td style="width: 15%;height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;letter-spacing: 2px;">
                                    合同会签流程
                                </td>
                                <td style="width: 85%;height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 1%;" colspan="3">
                                    <a href="/finance/business_contract_detail_view?id={{ obj.countersign_id.id }}">{{ obj.countersign_id.contract_name }}</a>
                                </td>
                            {% else %}
                                <td style="width: 15%;height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;letter-spacing: 2px;">
                                    行政公文流程
                                </td>
                                <td style="width: 85%;height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 1%;" colspan="3">
                                    <a href="/personal-center/document_approve.html?id={{ obj.conference_id.id }}">{{ obj.conference_id.conference_memo_text }}</a>
                                </td>
                            {% endif %}
                        </tr>
                    {% endif %}
                    <tr style="width: 100%;">
                        <td style="width: 15%;border-right: #cfcfcf solid 0.5px;border-left: #cfcfcf solid 0.5px;border-bottom: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;text-align: right;padding-right: 1%;">
                            备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注
                        </td>
                        <td style="height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 0.5%;" colspan="3" id="note" contenteditable="{{ is_edit }}">{{ obj.note }}</td>
                    </tr>
                    {% if obj.state == 'four' or obj.state == 'eight' %}
                        <tr style="width: 100%;">
                            <td style="width: 15%;height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;">
                                抄&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送
                            </td>
                            <td style="width: 85%;height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 1%;" id="conferee" colspan="3" onclick="model_line()">
                            </td>
                        </tr>
                    {% endif %}
                </table>

                {% if is_edit == 'true' %}
                    <!--附件-->
                    <table style="width: 100%;">
                        <thead>
                        <tr style="width: 100%;">
                            <td colspan="6" style="width: 100%;margin-left: 2.5%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5;border: #cccccc solid 0.5px;color: #1E90FF;padding-right: 1%;border-top: none;">
                                上传附件
                                <a href="javascript:;" class="file" style="vertical-align: top;margin-top: 5px;float: right;">
                                    上传文件
                                    <input type="file" name="party_main_body" id="party_main_body"
                                           onchange="upload_accessory('file1', 'party_main', 'party_main_body')">
                                </a>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 5%;border: #cccccc solid 1px;text-align: center;">序号</td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                文件名称
                            </td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                文件大小
                            </td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                上传时间
                            </td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                上传人员
                            </td>
                            <td style="width: 15%;border: #cccccc solid 1px;border-left: none;text-align: center;">操作
                            </td>
                        </tr>
                        </thead>
                        <tbody style="overflow: auto;" id="party_main">
                        {% for record in main_file_list %}
                            <tr>
                                <td style="width: 5%;border: #cccccc solid 1px;text-align: center;">{{ forloop.counter }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.file_name }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.file_size }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.upload_time }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.uploader }}</td>
                                <td style="width: 15%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                    <a target='_blank' href="{{ record.file_path }}">查看</a> | <a style="color: red;"
                                                                                                 href='#'
                                                                                                 onclick='RemoveTr(this, "party_main", {{ record.id }})'>删除</a>
                                </td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                {% endif %}
            </div>

            <div style="width: 90%;margin-left: 5%;">
                <table style="width: 100%;">
                    <tr style="width: 100%;">
                        <td colspan="4" style="width: 100%;margin-left: 2.5%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5;border: #cccccc solid 0.5px;color: #1E90FF;border-top: none;">
                            审批详情
                        </td>
                    </tr>
                    <!--科室负责人意见-->
                    {% if "C/D" in audit_dic %}
                        <tr id="fzrcs_tr" style="width: 100%;">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                科室负责人意见
                            </td>
                            <td id="fzrcs" colspan="3"
                                style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'C/D' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div id="fzrcs_op"
                                                     style="width: 100%;line-height: 20px;position: relative;">
                                                    <!--                                            {{ item.audit_user }}-->
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    <!--分管领导意见-->
                    {% if 'B' in audit_dic %}
                        <tr id="fgld_tr" style="width: 100%;">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                分管领导意见
                            </td>
                            <td id="zhuren" colspan="3"
                                style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'B' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    <!--分管领导意见-->
                    {% if 'ys' in audit_dic %}
                        <tr style="width: 100%;">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                院&nbsp;&nbsp;长&nbsp;&nbsp;授&nbsp;&nbsp;权
                            </td>
                            <td colspan="3"
                                style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'ys' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    {% if 'sjk' in audit_dic %}
                        <tr id="" style="width: 100%">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                审计科审核意见
                            </td>
                            <td colspan="3" style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'sjk' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    <!--办公室意见-->
                    {% if 'BGS' in audit_dic %}
                        <tr style="width: 100%;">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                党政办审核盖章
                            </td>
                            <td id="bangongshi" colspan="3"
                                style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'BGS' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    {% if item.state_display == '同意' %}
                                                        已审核
                                                    {% else %}
                                                        <span>{{ item.state_display }}</span>
                                                    {% endif %}
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    <!--主任意见-->
                    {% if 'YB' in audit_dic %}
                        <tr id="ybzr_tr" style="width: 100%;">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                办公室主任意见
                            </td>
                            <td id="fenguan" colspan="3"
                                style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'YB' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    {% if item.state_display == '同意' %}
                                                        已审核
                                                    {% else %}
                                                        <span>{{ item.state_display }}</span>
                                                    {% endif %}
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    {% if 'YZ' in audit_dic %}
                        <tr id="yz_sc" style="width: 100%">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                书记/院长审核意见
                            </td>
                            <td colspan="3" style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'YZ' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    {% if 'END' in audit_dic %}
                        <tr style="width: 100%">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                党政办审核盖章
                            </td>
                            <td colspan="3" style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'END' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    {% if item.state_display == '同意' %}
                                                        已审核
                                                    {% else %}
                                                        <span>{{ item.state_display }}</span>
                                                    {% endif %}
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}
                </table>
            </div>

            {% if copy_flag == 'ture' %}
                <div style="width: 90%;margin-left: 5%;">
                    <table style="width: 100%;">
                        <tr style="width: 100%;">
                            <td colspan="4" style="width: 100%;margin-left: 2.5%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5;border: #cccccc solid 0.5px;color: #1E90FF;border-top: none;">
                                抄送详情
                            </td>
                        </tr>
                        <tr style="width: 100%;">
                            <td colspan="4" style="width: 100%;border: #cccccc solid 0.5px;border-top: none;padding-left: 1%;">
                                <div style="width: 98%;position: relative;">
                                    {% for foo in copy_obj %}
                                        <div style="width: 100%; height: 80px; border-bottom: 1px solid rgb(204, 204, 204);">
                                            <div>
                                                <span>{% if foo.look_over == '1' %} 已查看 {% else %} 未查看 {% endif %}</span>
                                            </div>
                                            <div>
                                                {% if foo.look_over == '1' %}
                                                    {% if foo.recipient.signature_picture %}
                                                        <img style="width: 100px;height: 40px;" src="/media/{{ foo.recipient.signature_picture }}">
                                                    {% else %}
                                                        {{ foo.recipient.real_name }}
                                                    {% endif %}
                                                {% else %}
                                                    {{ foo.recipient.real_name }}
                                                {% endif %}
                                            </div>
                                            <div style="position: absolute; right: 0px; width: 300px; text-align: right; color: rgb(11, 11, 11); line-height: 0px;">
                                                {% if foo.look_over == '1' %}
                                                    {{ foo.update_time|date:'Y-m-d H:i' }}
                                                {% endif %}
                                            </div>
                                        </div>
                                    {% endfor %}
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            {% endif %}
        </div>
    </div>

    <div id="LH" style="width: 100%;height: 94%;background: white;display: none;">
        <div style="display: inline-block;width: 20%;vertical-align: top;height: 99%">
            <div style="width: 100%;height: 40px;background: #c8cbcf;padding-left: 2%;line-height: 40px;color: #0c6fd9;">
                附件
            </div>
            <div id="yt_zhengwen" style="width: 100%;">
                {% for item in main_file_list %}
                    {% if item.file_type == '0' %}
                        <div><a href="#" title="{{ item.file_name }}" class="a_tag_cla" onclick="chage_yulan(this, '{{ item.file_path }}')">{{ item.file_name }}</a></div>
                    {% endif %}
                {% endfor %}
            </div>
            {% if flag == 'true' %}
                <div style="width: 100%;height: 40px;background: #c8cbcf;padding-left: 2%;line-height: 40px;color: #0c6fd9;">
                    盖章文件
                </div>
                <div id="yt_zhengwen1" style="width: 100%;">
                    {% for item in main_file_list %}
                        {% if item.file_type == '1' %}
                            <div><a href="#" title="{{ item.file_name }}" class="a_tag_cla" onclick="chage_yulan(this, '{{ item.file_path }}')">{{ item.file_name }}</a></div>
                        {% endif %}
                    {% endfor %}
                </div>
            {% endif %}
        </div>
        <div style="display: inline-block;width: 78%;vertical-align: top;height: 99%;text-align: center;" id="fujian">
            {% if 'jpg' in file_path or 'JPG' in file_path or 'JPEG' in file_path or 'jpeg' in file_path or 'PNG' in file_path or 'png' in file_path %}
                <img src="{{ file_path }}" alt="" style="width: 800px;height: 100%;">
            {% else %}
                <embed id="embed_file" src="{{ file_path }}" type="application/pdf" style="width: 100%;height: 100%;">
            {% endif %}
        </div>
    </div>

    <div id="lct" style="width: 100%;height: 94%;background: white;display: none;">
        <div style="width: 100%;height: 40%;text-align: center;margin: 20% auto;">
            <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                <div style="text-align: center;color: #0d8ddb;">
                    ({{ obj.apply_user.real_name }})<br>
                    发起人
                </div>
                <div style="width: 50px;height: 25px;border-radius: 3px;background: #0d8ddb;color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                    start
                </div>
            </div>

            {% if 'C/D' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'C/D' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                科室负责人
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'B' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'B' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                分管领导
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'ys' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'ys' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                院领导
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'sjk' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'sjk' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                审计科审核
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'BGS' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'BGS' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                党政办审核盖章
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'stb' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'stb' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                审计科审核
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'YB' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'YB' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                院办主任
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'YZ' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'YZ' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                书记/院长
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'END' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'END' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                党政办审核盖章
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            <div style="display: inline-block;border: #0d8ddb solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
            <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                <div style="text-align: center;color: #0d8ddb;">
                    <span style="visibility: hidden;">({{ obj.apply_user.real_name }})</span><br>
                    结束
                </div>
                <div style="width: 50px;height: 25px;border-radius: 3px;background: #0d8ddb;color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                    ending
                </div>
            </div>
        </div>
    </div>

    <div id="del_adjunct"
         style="z-index: 1000;position: fixed;background-color: rgba(36, 36, 36, 0.5);width: 100%;height: 100%;top: 0;left: 0;right: 0;bottom: 0;display: none;">
        <div style="top: 50%;left: 50%;width: 400px;height: 150px;background: white;transform:translate(-50%,-50%);border: #dfdfdf solid 1px;position: absolute;border-radius: 4px;">
            <div style="width: 100%;height: 100px;text-align: center;line-height: 100px;">请查看附件，删除无用的附件！</div>
            <hr>
            <div style="width: 100%;height: 50px;text-align: right;padding-right: 5%;">
                <button onclick="del_adjunct_button()"
                        style="width: 50px;height: 30px;line-height: 30px;margin-top: 10px;background: #00a0e9;color: white;border-radius: 4px;border: #00a0e9 solid 1px;">
                    确认
                </button>
            </div>
        </div>
    </div>
    <script src="../../static/system_setup/creat_from/js/jquery-1.10.2.js"></script>
    <script>
        window.onload = function () {
            document.getElementById("loading").style.display = "none";
        }
        var Quick = "{{ Quick | safe }}";
        var uuid = "{{ obj.fj_number }}"
        function change_mind(ele_id) {
            if (ele_id === "DW") {
                document.getElementById("DW").style.display = "inline-block";
                document.getElementById("DW_tag").className = "tab_top top_tag";
                document.getElementById("LH_tag").className = "tab_top";
                document.getElementById("LH").style.display = "none";
                document.getElementById("lct_tag").className = "tab_top";
                document.getElementById("lct").style.display = "none";
            } else if (ele_id === "LH"){
                document.getElementById("LH").style.display = "inline-block";
                document.getElementById("LH_tag").className = "tab_top top_tag";
                document.getElementById("DW_tag").className = "tab_top";
                document.getElementById("DW").style.display = "none";
                document.getElementById("lct_tag").className = "tab_top";
                document.getElementById("lct").style.display = "none";
            }else {
                document.getElementById("lct").style.display = "inline-block";
                document.getElementById("lct_tag").className = "tab_top top_tag";
                document.getElementById("DW_tag").className = "tab_top";
                document.getElementById("DW").style.display = "none";
                document.getElementById("LH_tag").className = "tab_top";
                document.getElementById("LH").style.display = "none";
            }
        }

        // 修改
        function ExportCar() {
            var fenshu = document.getElementById("fenshu").value;                   // 用印份数
            if (Quick === "true") {
                var yysy = document.getElementById("yysy").value;             // 用印事由
            }else {
                yysy = document.getElementById("yysy").innerText;
            }
            var selectButton_1 = document.getElementById("selectButton_1").innerText;       // 印章名称
            var note = document.getElementById('note').innerText;                       // 备注
            if (document.getElementById('zjmc')) {
                var credentials = document.getElementById('zjmc').value;            // 证件名称
            }else {
                credentials = "";
            }

            var reg = RegExp(/其他证书/);
            var leader_select = document.getElementById("leader_select").value;
            var FileType = document.getElementById("FileType").value;

            var YDetail = "";
            if (yysy === "其他") {
                YDetail = document.getElementById('YDetail').innerText;
                if (!YDetail) {
                    alert("请填写用印详情！")
                    return false
                }
            }

            if (selectButton_1.match(reg)){
                if (!credentials) {
                    alert('选择其他证书类型时,必须填写证件名称!!!')
                    return false
                }
            }

            if (FileType === "0") {
                alert('选择盖章文件类型!!!')
                return false
            }

            var QuickApplication = $("input[type=radio][name=QuickApplication]:checked").val();
            var shouquan = []
            if (QuickApplication === 'yes') {
                var shouquantype_list = document.getElementsByClassName("shouquantype");
                for (var sq=0; sq<shouquantype_list.length; sq++) {
                    if (shouquantype_list[sq].checked) {
                        shouquan.push(shouquantype_list[sq].value)
                    }
                }
                if (!shouquan.length){
                    alert('请上传授权类型！')
                    return false
                }
            }else {
                if (!leader_select) {
                    alert('请选择分管领导!')
                    return false
                }
            }

            var data_str = "id={{ obj.id }}&servings=" + fenshu + "&seal_name=" + selectButton_1 + "&credentials=" + credentials + "&matter_type_text=" + yysy + "&note=" + note+"&QuickApplication="+String(QuickApplication)+"&leader_select="+String(leader_select)+"&shouquan="+JSON.stringify(shouquan)+"&YDetail="+String(YDetail)+"&FileType="+FileType;

            if (!fenshu || fenshu === '0') {
                alert("请填写用印份数！");
                return false
            }
            if (!selectButton_1) {
                alert("用印类型不能为空！");
                return false
            }
            if (!yysy) {
                alert('请填写用印事由！');
                return false
            }

            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/back-management/seal_process_modification", true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send(data_str);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert("修改成功！")
                            window.location.reload();
                        } else {
                            alert(JsonDate["message"])
                        }
                    }
                }
            };
        }

        function chage_yulan(this_, file_path) {
            var fujian = document.getElementById("fujian");
            var file_index = file_path.lastIndexOf(".")
            var ext = file_path.substring(file_index+1)
            var arr=['jpg', 'JPG', "JPEG", "jpeg", "PNG", "png"];
            var ext_index=arr.indexOf(ext);
            if (ext_index === -1){
                fujian.innerHTML = '<embed id="embed_file" src="'+file_path+'" type="" style="width: 100%;height: 100%;">'
            }else {
                fujian.innerHTML = '<img src="' + file_path + '" alt="application/pdf" style="width: 800px;height: 100%;">'
            }

            var a_tag_list = document.getElementsByClassName("a_tag_cla");
            for (var i = 0;i<a_tag_list.length; i++){
                a_tag_list[i].style.background='';
            }
            this_.style.background='#cfcfcf';
        }

        function myclick1() {
            var selecteddiv = document.getElementById("selectdiv_1");
            selecteddiv.style.display = "block";
        }

        function mousein1() {
            var selecteddiv = document.getElementById("selectdiv_1");
            selecteddiv.style.display = "block";
        }

        //鼠标离开多选框的div【selectdiv】
        function mouseout1() {
            var selecteddiv = document.getElementById("selectdiv_1");
            selecteddiv.style.display = "none";
        }

        //checkbox的点击事件
        function mycheck1(obj) {
            var checked_list = document.getElementsByClassName("check_anniu");
            var checked_value = []
            if (obj.checked) {
                for (var t = 0; t < checked_list.length; t++) {
                    if (checked_list[t].checked) {
                        checked_value.push(checked_list[t].value)
                    }
                }
            }
            document.getElementById("selectButton_1").innerText = checked_value.join(", ");
        }

        // 删除附件
        function RemoveTr(_this, tbody_id, wj_id) {
            var table = document.getElementById(tbody_id);
            var trNode = $(_this).parent().parent();
            trNode.remove();

            for (var i=0; i<table.children.length; i++){
                table.children[i].children[0].innerHTML=i+1;
            }

            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/delete_attachments_view", true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send("id="+String(wj_id));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        alert("删除成功！")
                    }
                }
            };
        }

        // 上传附件
        function upload_accessory(file_type, tbody_id, accessory_type) {
            document.getElementById("loading").style.display = "inline-block";
            var form = new FormData();
            var files = document.getElementById(accessory_type).files[0];
            form.append(file_type, files);
            form.append('number', "{{ obj.fj_number }}")
            form.append('source', 'yysq');
            form.append('admin', 'true');

            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/topics_attachments_upload", true);
            xhr.send(form);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        creat_table(JsonDate, tbody_id)
                    }
                }
            };
        }

        // 创建附件列表
        function creat_table(JsonData, tbody_id) {
            var t_table = document.getElementById(tbody_id);
            var local_host = window.location.host;
            if (Array.isArray(JsonData["pdf_path"])) {
                for (var i = 0; i < JsonData["pdf_path"].length; i++) {
                    var tr = document.createElement("tr");var td1 = document.createElement("td");var td2 = document.createElement("td");var td3 = document.createElement("td");var td4 = document.createElement("td");var td5 = document.createElement("td");var td6 = document.createElement("td");
                    td1.innerHTML = t_table.children.length + 1;td1.style.textAlign = "center";td1.style.height='40px';td1.style.border = "#cccccc solid 1px";td1.style.borderTop='none';td1.style.borderTop = "none";
                    td2.innerHTML = JsonData["file_name"];td2.style.paddingLeft = "1%";td2.style.height='40px';td2.style.border = "#cccccc solid 1px";td2.style.borderTop='none';td2.style.borderLeft = "none";td2.style.borderTop = "none";
                    td3.innerHTML = JsonData["file_size"];td3.style.textAlign = "center";td3.style.height='40px';td3.style.border = "#cccccc solid 1px";td3.style.borderTop='none';td3.style.borderLeft = "none";td3.style.borderTop = "none";
                    td4.innerHTML = JsonData["upload_time"];td4.style.textAlign = "center";td4.style.height='40px';td4.style.border = "#cccccc solid 1px";td4.style.borderTop='none';td4.style.borderLeft = "none";td4.style.borderTop = "none";
                    td5.innerHTML = JsonData["uploader"];td5.style.textAlign = "center";td5.style.height='40px';td5.style.border = "#cccccc solid 1px";td5.style.borderTop='none';td5.style.borderLeft = "none";td5.style.borderTop = "none";
                    td6.innerHTML = "<a target='_blank' href='" + JsonData["pdf_path"][i]["pdf_path"] + "'>查看</a> | <a style='color: red;' href='#' onclick='RemoveTr(this, \"" + tbody_id + "\", \"" + JsonData["pdf_path"][i]["id"] + "\")'>删除</a>";
                    td6.style.textAlign = "center";td6.style.height='40px';td6.style.border = "#cccccc solid 1px";td6.style.borderTop='none';td6.style.borderLeft = "none";td6.style.borderTop = "none";
                    tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);tr.appendChild(td4);tr.appendChild(td5);tr.appendChild(td6);
                    t_table.appendChild(tr);
                }
                if (JsonData["pdf_path"].length > 1) {
                    document.getElementById("del_adjunct").style.display = 'block';
                }
            } else {
                tr = document.createElement("tr");td1 = document.createElement("td");td2 = document.createElement("td");td3 = document.createElement("td");td4 = document.createElement("td");td5 = document.createElement("td");td6 = document.createElement("td");
                td1.innerHTML = t_table.children.length + 1;td1.style.textAlign = "center";td1.style.height='40px';td1.style.border = "#cccccc solid 1px";td1.style.borderTop='none';td1.style.borderTop = "none";
                td2.innerHTML = JsonData["file_name"];td2.style.paddingLeft = "1%";td2.style.height='40px';td2.style.border = "#cccccc solid 1px";td2.style.borderTop='none';td2.style.borderLeft = "none";td2.style.borderTop = "none";
                td3.innerHTML = JsonData["file_size"];td3.style.textAlign = "center";td3.style.height='40px';td3.style.border = "#cccccc solid 1px";td3.style.borderTop='none';td3.style.borderLeft = "none";td3.style.borderTop = "none";
                td4.innerHTML = JsonData["upload_time"];td4.style.textAlign = "center";td4.style.height='40px';td4.style.border = "#cccccc solid 1px";td4.style.borderTop='none';td4.style.borderLeft = "none";td4.style.borderTop = "none";
                td5.innerHTML = JsonData["uploader"];td5.style.textAlign = "center";td5.style.height='40px';td5.style.border = "#cccccc solid 1px";td5.style.borderTop='none';td5.style.borderLeft = "none";td5.style.borderTop = "none";
                td6.innerHTML = "<a target='_blank' href='" + JsonData["pdf_path"] + "'>查看</a> | <a style='color: red;' href='#' onclick='RemoveTr(this, \"" + tbody_id + "\", \"" + JsonData["id"] + "\")'>删除</a>";
                td6.style.textAlign = "center";td6.style.height='40px';td6.style.border = "#cccccc solid 1px";td6.style.borderTop='none';td6.style.borderLeft = "none";td6.style.borderTop = "none";
                tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);tr.appendChild(td4);tr.appendChild(td5);tr.appendChild(td6);
                t_table.appendChild(tr);
            }
        }

    </script>
</body>
</html>